<template>
  <div class="app">
    <router-view>
      <template #default="{ Component }">
        <component :is="Component" />
      </template>
    </router-view>
  </div>
</template>

<script lang="ts" setup>
import { reactive, onMounted } from 'vue'
import * as api from '@/api/common.js'
const data = reactive({})
const happy = ''

localStorage.getItem('token')

const getLoginNoCode = () => {
  const params = {
    password: 'admin123',
    username: 'admin'
  }
  api.loginNoCode(params).then((res) => {
    // console.log(res)
    localStorage.setItem('token', res.token)
  })
}

onMounted(() => {
  getLoginNoCode()
})
</script>

<style lang="less" scoped>
.app {
  height: 100vh;
  width: 100vw;
  background-color: #000;
  overflow-x: hidden;
}
</style>
